<template>
    <div class="comment-info">
      <div class="info-user">
        <img :src="commentInfo.avatar" alt="">
        <span>{{ commentInfo.name }}</span>
      </div>
      <div class="info-detail">
        <p>{{ commentInfo.content }}</p>
        <span class="date">{{ commentInfo.created | showDate }}</span>
      </div>
    </div>
</template>

<script>
  import { formatDate } from 'common/utils'
    export default {
        name: "DetailCommentInfo",
      props:{
          commentInfo:{
            type:Object,
            default(){
              return{ }
            }
          }
      },
      filters:{
        showDate(value){
          //1.将时间戳转化成Date对象
          const date = new Date(value*1000)
          //2.将date进行格式化
          return formatDate(date,'yyyy-MM-dd')
        }
      }
    }
</script>

<style scoped>

</style>
